package com.lesama.array;

public class ArrayDemo4 {
    public static void main(String[] args) {
        int[] arr1 = {1, 2, 3, 4, 5};
        int[] arr2 = arr1;
        System.out.println(arr1);
        System.out.println(arr2);
        int number = 22;
        number = change(number);
        System.out.println(number);
        changeArray(arr1);
        for (int i = 0; i < arr1.length; i++) {
            System.out.println(arr1[i]);
        }
    }
    public static void changeArray(int[] arr) {
        arr[1] = 50;
    }
    // 函数参数是形参，若形参为基本数据类型，则为值传递
    // 若形参为引用数据类型，则为址传递
    public static int change(int number) {
        number = 66;
        return number;
    }
}
